package com.phantasy.managers
{
	import com.phantasy.managers.ToolTipManager;
	import com.phantasy.common.cursor.CursorManager;
	import com.phantasy.layers.AlertLayer;
	import com.phantasy.layers.UILayer;
	import com.phantasy.managers.WindowManager;
	
	import flash.display.Sprite;
	import flash.display.Stage;

	/**
	 *层级管理 
	 * @author Liseen
	 * 
	 */	
	public class LayerManager
	{
		public static var mainApp:Sprite;
		public static var stage:Stage;
		public static var sceneLayer:Sprite;
		public static var uiLayer:UILayer;
		public static var windowLayer:Sprite;
		public static var alertLayer:AlertLayer;
		public function LayerManager()
		{
		}
		
		public static function init(main:Sprite, stageValue:Stage):void
		{
			mainApp = main;
			stage = stageValue;
		}
		
		/**
		 *创建层 
		 * 
		 */		
		public static function createLayers():void
		{
			stage.stageFocusRect = false;
			CursorManager.init(mainApp);
			sceneLayer = new Sprite();
			sceneLayer.tabEnabled = sceneLayer.tabChildren = false;
			mainApp.addChild(sceneLayer);
			uiLayer = new UILayer();
			uiLayer.tabEnabled = uiLayer.tabChildren = false;
			mainApp.addChild(uiLayer);
			windowLayer = new Sprite();
			windowLayer.mouseEnabled = false;
			windowLayer.tabEnabled = windowLayer.tabChildren = false;
			mainApp.addChild(windowLayer);
			WindowManager.getInstance().registerWindowContainer(windowLayer);
			alertLayer = new AlertLayer();
			mainApp.parent.addChild(alertLayer);
			ToolTipManager.getInstance().registerContainer(stage);
		}
	}
}